correctness and the loop invariant hackerrank